import 'package:meta/meta.dart';
import 'dart:convert';
import 'package:json_annotation/json_annotation.dart';

part 'search_history.g.dart';
@JsonSerializable()
class SearchHistory {
  @JsonKey(name: "items")
  List<Item> items;
  SearchHistory({ List<Item> items})
      : items = items ?? <Item>[];
  factory SearchHistory.fromJson(Map<String, dynamic> json) => _$SearchHistoryFromJson(json);

  Map<String, dynamic> toJson() => _$SearchHistoryToJson(this);
}

@JsonSerializable()
class Item {
  final String name;
  final String date;

  Item({this.name, this.date});

  factory Item.fromJson(Map<String, dynamic> json) => _$ItemFromJson(json);


  Map<String, dynamic> toJson() => _$ItemToJson(this);

}
